﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="browerOne.aspx.cs" Inherits="PropertyManagement.xinwen.browerOne" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        body
       {
           width:700px;
           margin:0 auto;
       }
       #div0
       {
           width:700px;
           height:1000px;
           margin:20px auto;        
           background-color:#ceebfb;
       }
       
       #DataList1,#GridView1,#DataList2
       {
            margin:10px auto;
       }
       ul{
           list-style:none;
       }
       ul li{
           padding-bottom:8px;
           font-size:16px;
       }
       #div1{
           font-size:18px;
           margin-left:20px;
       }
       #DataList2 table{
           margin-left: 20px;
       }
       #DataList2 table #tr1{
           width:100%;
           height:30px;
           background-color:#99d1f4;
       }
       #DataList2 table tr #tr2{
           background-color:#f6f9cd;
       }
       #DataList2 table tr td{
           border:1px solid #99d1f4;
           margin:0;
           padding:0;
       }
       h3{
           text-align:center;
           margin:0;
           padding:0;
       }
       #DataList1,#DataList2{
           margin:0;
           padding:0;
       }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div id="div0">
            <h3>使用DataList ul绑定数据</h3>
             <asp:DataList ID="DataList1" runat="server" Height="288px" Width="550px">
                <ItemTemplate>
                    <ul>
                        <li>新闻标题：<%# Eval("stitle") %></li>
                        <li>新闻内容：<%# Eval("content") %></li>
                        <li>发布时间：<%# Eval("stime","{0:yyyy-MM-dd}") %></li>
                        <li>新闻类别：<%# Eval("leibie") %></li>
                        <li>状态：<%# Eval("sstatus") %></li>
                        <li>发布人：<%# Eval("person") %></li>
                    </ul>
                </ItemTemplate>
                <FooterTemplate>
                    <div id="div1"><a href="../zhuye/centerMuban.aspx">返回</a></div>
                     
                </FooterTemplate>
            </asp:DataList>
            <br />
            
            <h3>使用GridView绑定数据</h3>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                AllowPaging="True" Height="127px" PageSize="3" Width="642px" CssClass="auto-style2">
                            <Columns>
                                <asp:BoundField DataField="stitle" HeaderText="新闻标题" />
                                <asp:BoundField DataField="content" HeaderText="新闻内容" />
                                <asp:BoundField DataField="stime" HeaderText="新闻发布日期" DataFormatString="{0:yyyy-MM-dd}" />
                                <asp:BoundField DataField="leibie" HeaderText="新闻类别" />
                                <asp:BoundField DataField="sstatus" HeaderText="状态" />
                                <asp:BoundField DataField="person" HeaderText="发布人" />
                            </Columns>
                            <PagerSettings Visible="False" />
                        </asp:GridView>
            <br />

            <h3>使用DataList table绑定数据</h3>
            <asp:DataList ID="DataList2" runat="server" Height="269px" Width="659px">
                <HeaderTemplate>
                    <table>
                <tr class="tr1">
                    <td>新闻标题</td>
                    <td>新闻内容</td>
                    <td>发布时间</td>
                    <td>新闻类别</td>
                    <td>状态</td>
                    <td>发布人</td>
                </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                    <td><%# Eval("stitle") %></td>
                    <td><%# Eval("content") %></td>
                    <td><%# Eval("stime","{0:yyyy-MM-dd}") %></td>
                    <td><%# Eval("leibie") %></td>
                    <td><%# Eval("sstatus") %></td>
                    <td><%# Eval("person") %></td>
                </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                    <br />
                    <div id="div1"><a href="../zhuye/centerMuban.aspx">返回</a></div>
                     
                </FooterTemplate>
            </asp:DataList>
        </div>
    </form>
</body>
</html>
